package com.zhonghui.modlules.product.controller;

import com.zhonghui.common.eshopUtil.ApiResult;
import com.zhonghui.common.eshopUtil.CateDTO;
import com.zhonghui.modlules.product.eshopService.StoreCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequiredArgsConstructor(onConstructor = @_(@Autowired))
@Api(value = "商品分类",tags = "商品分类")
public class StoreCategoryController {

    private final StoreCategoryService storeCategoryService;

    @ApiOperation(value = "商品分类列表",notes = "商品分类列表")
    @GetMapping("/category")
    public ApiResult<List<CateDTO>> category(){
        return ApiResult.ok(storeCategoryService.getList());
    }
}
